<script setup>
import { onMounted } from "vue";
import { userStore } from "./store/user";

/**
 * 主组件挂载完成后,验证用户登录状态
 * 如果未登录,则尝试重新获取令牌
 */
onMounted(() => {
  let store = userStore();
  if (!store.isLogin) {
    store.reload();
  }
});
</script>

<template>
  <div>
    <Transition name="fade" mode="out-in">
      <router-view></router-view>
    </Transition>
  </div>
</template>

<style>
</style>
